package io.jsen.meta.diff.obj.special;

import io.jsen.meta.diff.field.MetaField;
import io.jsen.meta.diff.obj.MetaObject;
import lombok.EqualsAndHashCode;

import static io.jsen.meta.diff.support.MetaChangeModifier.setDelete;

/**
 *
 * 代表删除字段
 *
 * @author jsen
 * @date 2021/4/6
 */
@EqualsAndHashCode(callSuper = true)
public class MetaDelete extends MetaObject<MetaDelete, MetaDelete.Delete> {
    private static final Delete DELETE = new Delete();
    public MetaDelete(MetaField metaField) {
        super(metaField, DELETE);
        this.index = DELETE.toString();
    }

    @Override
    protected int calState(MetaDelete obj) {
        return setDelete(0);
    }

    public static final class Delete {
        @Override
        public String toString() {
            return "delete";
        }
    }
}
